package com.example.demo.controller;




import com.example.demo.ao.AttendanceRecordsAo;
import com.example.demo.service.AttendanceReportService;
import com.example.demo.vo.AttendanceReportVo;
import com.example.demo.vo.AttendanceReportWeekVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/attendance")
@Slf4j
public class AttendanceRecordsController {


    @Autowired
    private AttendanceReportService attendanceReportService;



    @PostMapping("day")
    public List<AttendanceReportVo> getAttendanceReport(@RequestBody AttendanceRecordsAo attendanceRecordsAo) {
        return attendanceReportService.getAttendanceReport(attendanceRecordsAo);
    }


    @PostMapping("month")
    public List<AttendanceReportWeekVo> getAttendanceReportWeek(@RequestBody AttendanceRecordsAo attendanceRecordsAo) {
        return attendanceReportService.getAttendanceReportWeek(attendanceRecordsAo);
    }
}
